{include file="public_head" /}

<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">


<body class="nav-md">

<div class="container body">

    <div class="main_container">

        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">

                <div class="page-title">
                    <div class="title_left">
                        <h3>用户管理</h3>
                    </div>

                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}
                                    <!--<small>different form elements</small>-->
                                </h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                    </li>
                                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <br/>
                                <form class="form-horizontal form-label-left" action="" method="post" id="registerForm">

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">头　　像：</label>
                                        <div class="col-md-9 col-sm-6 col-xs-12">
                                            <label class="radio_box">
                                                <input type="radio" name="avatar" id="avatar_1" class="cartradio"
                                                       value="man1" datatype="*"
                                                       nullmsg="请选择用户头像！" errormsg="请选择用户头像！"
                                                       {eq name='data.avatar|default=""' value='man1'}
                                                       checked
                                                       {/eq}
                                                >&nbsp;
                                                <label for="avatar_1"
                                                       style="margin-top: 35px;margin-left: -5px;"></label>
                                                <span><img src="__STATIC__/images/man1.jpg" height="100"/></span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="avatar" id="avatar_2" class="cartradio"
                                                       value="man2" datatype="*"
                                                       nullmsg="请选择用户头像！" errormsg="请选择用户头像！"
                                                       {eq name='data.avatar|default=""' value='man2'}
                                                       checked
                                                       {/eq}
                                                >&nbsp;
                                                <label for="avatar_2"
                                                       style="margin-top: 35px;margin-left: -5px;"></label>
                                                <span><img src="__STATIC__/images/man2.jpg" height="100"/></span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="avatar" id="avatar_3" class="cartradio"
                                                       value="man3" datatype="*"
                                                       nullmsg="请选择用户头像！" errormsg="请选择用户头像！"
                                                       {eq name='data.avatar|default=""' value='man3'}
                                                       checked
                                                       {/eq}
                                                >&nbsp;
                                                <label for="avatar_3"
                                                       style="margin-top: 35px;margin-left: -5px;"></label>
                                                <span><img src="__STATIC__/images/man3.jpg" height="100"/></span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <!--女-->
                                            <label class="radio_box">
                                                <input type="radio" name="avatar" id="avatar_4" class="cartradio"
                                                       value="girls1" datatype="*"
                                                       nullmsg="请选择用户头像！" errormsg="请选择用户头像！"
                                                       {eq name='data.avatar|default=""' value='girls1'}
                                                       checked
                                                       {/eq}
                                                >&nbsp;
                                                <label for="avatar_4"
                                                       style="margin-top: 35px;margin-left: -5px;"></label>
                                                <span><img src="__STATIC__/images/girls1.jpg" height="100"/></span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="avatar" id="avatar_5" class="cartradio"
                                                       value="girls2" datatype="*"
                                                       nullmsg="请选择用户头像！" errormsg="请选择用户头像！"
                                                       {eq name='data.avatar|default=""' value='girls2'}
                                                       checked
                                                       {/eq}
                                                >&nbsp;
                                                <label for="avatar_5"
                                                       style="margin-top: 35px;margin-left: -5px;"></label>
                                                <span><img src="__STATIC__/images/girls2.jpg" height="100"/></span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="avatar" id="avatar_6" class="cartradio"
                                                       value="girls3" datatype="*"
                                                       nullmsg="请选择用户头像！" errormsg="请选择用户头像！"
                                                       {eq name='data.avatar|default=""' value='girls3'}
                                                       checked
                                                       {/eq}
                                                >&nbsp;
                                                <label for="avatar_6"
                                                       style="margin-top: 35px;margin-left: -5px;"></label>
                                                <span><img src="__STATIC__/images/girls3.jpg" height="100"/></span>
                                                &nbsp;&nbsp;
                                            </label>

                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">用 户 名：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="管理员后台显示的昵称"
                                                   class="form-control col-md-7 col-xs-12" name="username"
                                                   value="{$data.username|default=''}" datatype="*"
                                                   nullmsg="请填写用户名！" errormsg="请填写用户名！"
                                                   onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9]/g,'')"
                                                   onpaste="value=value.replace(/[^\a-\z\A-\Z0-9]/g,'')"
                                                   oncontextmenu="value=value.replace(/[^\a-\z\A-\Z0-9]/g,'')">
                                        </div>
                                    </div>

                                    <div class=" divider-dashed">
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">密　　码：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="password"
                                                   class="form-control col-md-7 col-xs-12"
                                                   name="password"
                                                    {if condition="$Request.action eq 'create'"} plugin="passwordStrength"  datatype="*5-18" nullmsg="请输入密码！" errormsg="密码至少5个字符,最多18个字符！" placeholder="管理员登录时的密码"{else/} placeholder="如果不修改密码,请留空"{/if}
                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">确认密码：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="password"
                                                   class="form-control col-md-7 col-xs-12"
                                                   name="confirm_password"
                                                    {if condition="$Request.action eq 'create'"} recheck="password"  datatype="*6-18" nullmsg="请确认密码！" errormsg="两次输入的密码不一致！" placeholder="管理员登录时的密码"{else/} placeholder="如果不修改密码,请留空"{/if}
                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">昵　　称：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="管理员后台显示的昵称"
                                                   class="form-control col-md-7 col-xs-12" name="nickname"
                                                   value="{$data.nickname|default=''}"
                                                   datatype="*"
                                                   nullmsg="请填写用户昵称！" errormsg="请填写用户昵称！"
                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">手 机 号：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="联系电话,用于登录的时候接收验证码使用"
                                                   class="form-control col-md-7 col-xs-12"
                                                   name="telephone"
                                                   value="{$data.telephone|default=''}"
                                                   maxlength="11"
                                                   datatype="n"
                                                   nullmsg="请填写联系的手机号码！" errormsg="请填写正确的手机号码！"
                                            >
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">我绑定的门店：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="我绑定的门店" disabled
                                                   class="form-control col-md-7 col-xs-12"
                                                   value="{$data.shop_title|default=''}"
                                                   maxlength="11"


                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">用 户 组：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <select name="level" id="leve" class="select2_single" {eq name=":request()->action()" value="update"}disabled{/eq}
                                                    style="width: 100%;" tabindex="-1"
                                                    datatype="*"
                                                    nullmsg="请选择所在用户组！" errormsg="请选择所在用户组！"
                                            >
                                                {volist name='group' id='list'}
                                                <option value="{$list.id}" {eq name='data.level|default=""' value='$list.id'}selected{/eq}>{$list.title}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">上级业务员：</label>
                                        <div class="input-group" style="float: left;margin: 0 10px;">

                                            <select name="parent_id" id="status" class="select2_single" style="width: 300px;" {eq name=":request()->action()" value="update"}disabled{/eq}
                                                    tabindex="-1">
                                                <option value="0">-顶级业务员 -</option>
                                                {volist name="$salesman" id="vo"}
                                                <option value="{$vo.manage_id}" {eq name='$data.salesman_id|default=""' value='$vo.manage_id' }selected{/eq}>{neq name="$vo.parent_id" value="0"}{:str_repeat('&nbsp&nbsp&nbsp',$vo.level)}{/neq}|{:str_repeat('--',1)}{$vo.nickname}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">业务员直属关系提成比(%)：</label>
                                        <div class="col-md-5 col-sm-6 col-xs-12">
                                            <input   style="width:80%;" type="text" placeholder="业务员直属关系提成比"  name="per"
                                                   class="form-control col-md-7 col-xs-12"
                                                   value="{$data.per|default=''}"
                                                   maxlength="11"
                                            ><span style="position: relative;bottom: -4px;">(%)</span>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">状　　态：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <label class="radio_box">
                                                <input type="radio" name="status" id="status_1" class="cartradio"
                                                       value="1"
                                                       datatype="*"
                                                       nullmsg="请选择用户状态！" errormsg="请选择用户状态！"
                                                       {eq name='$data.status|default=""' value='1'}
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_1"></label>
                                                <span>启用</span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="status" id="status_2" class="cartradio"
                                                       value="0"
                                                       datatype="*"
                                                       nullmsg="请选择用户状态！" errormsg="请选择用户状态！"
                                                       {eq name='$data.status|default=""' value='0'}
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_2"></label>
                                                <span>禁用</span>
                                                &nbsp;&nbsp;
                                            </label>
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">注册时间：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            {empty name='data.create_time'}
                                            <input type="text" placeholder="请选择注册时间"
                                                   class="form-control col-md-7 col-xs-12" name="create_time"
                                                   value="{:date('Y-m-d H:i:s',time())}" onClick="WdatePicker()">
                                            {else /}
                                            <input type="text" placeholder="请选择注册时间"
                                                   class="form-control col-md-7 col-xs-12" name="create_time"
                                                   value="{$data.create_time}"
                                                   onClick="WdatePicker()">
                                            {/empty}
                                        </div>
                                    </div>

                                    <div class="ln_solid"></div>

                                    <div class="form-group">
                                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                                            {present name="$data.id"}
                                            <input type="hidden" name="id" value="{$data.id}">
                                            {/present}
                                            <button type="submit" class="btn btn-primary">提交</button>
                                            <a type="reset" class="btn btn-success" onclick="history.go(-1)">返回</a>
                                        </div>
                                    </div>

                                </form>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
            <!-- /page content -->

        </div>

    </div>
</div>

{include file="public_foot" /}

<!-- Datatables-->
<script src="__STATIC__/js/datatables/jquery.dataTables.min.js"></script>
<script src="__STATIC__/js/datatables/dataTables.bootstrap.js"></script>
<!-- Times -->
<script src='__STATIC__/js/datepicker/WdatePicker.js'></script>
<!-- validform -->
<script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<!--select-->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<script>
    //validform
    $(function () {

        $.Tipmsg.r = null;

        var showmsg = function (msg) {
            //假定你的信息提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
            alert(msg);
        }
        $("#registerForm").Validform({
            tiptype: function (msg) {
                layer.msg(msg);
            },
            tipSweep: true
        });


        // select2
        $(".select2_single").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
    })
</script>
</body>

</html>
